package com.ygqh.baby.service;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.ao.ResultSet;
import com.ygqh.baby.po.YgCategory;

import java.util.List;

public interface YgCategoryService {

	List<YgCategory> find();

	int findCount();

	YgCategory findById(Long id);

	int deleteSoft(Long[] ids);

	int deleteSoft(Long id);

	int save(YgCategory ygCategory);

	int update(YgCategory ygCategory);

	int saveOrUpdate(YgCategory ygCategory);

	ResultSet<YgCategory> search(QueryInfo queryInfo, String q);

	List<YgCategory> findTopLevel();

	List<YgCategory> findByParentId(Long parentId);

	List<YgCategory> findByParentIds(List<Long> ids);

	/**
	 * 根据末级分类ID，返回其一级二级分类
	 **/
	List<YgCategory> findParentsByCategoryId(Long categoryId);

	/**
	 * 查找末级分类
	 * 
	 * @return
	 */
	List<YgCategory> findLastLevel();

	/**
	 * 查找分类
	 * 
	 * @return
	 */
	List<YgCategory> findCategoryByLevel(Long level);

	List<YgCategory> findByIds(Long[] categoryId);

	boolean validateCategoryName(Long parentId, String categoryName, Long id);
	/**
	 * 根据分类名称查找分类
	 * @param categoryName 分类名称
	 * @param level 级别
	 * @return
	 */
	YgCategory findByCategoryName(String categoryName, Long level);

    String findCategoryNameByThirdCategoryId(Long categoryId);
}
